/**
 * Created by 小敏哥 on 2017/8/28.
 */
import React, {Component} from 'react';
import OverLineProcessDetail from '../processDetail/overLineProcessDetail';
import ProcessDetail from '../processDetail/index';
import style from './processDetails.scss';
class ProcessDetails extends Component {
    constructor(props) {
        super(props);
        this.state = {
            allowDate: this.getAllowDate(),//设置允许年检日期
        }
    }


    componentDidMount() {
        //作为页面不作为组件时才设置标题
        if(location.href.indexOf('processDetailsView')>=0) {
            document.querySelector("title").innerHTML = "办理年检";
        }
        // this.setActiveTab();
    }

    //获取免检办理时间区间
    getAllowDate() {
        var date = new Date();
        date.setFullYear(date.getFullYear() - 5);
        date.setDate(date.getDate() + 20);
        return date;
    }

    render() {
        // url = decodeURIComponent(url);
        return <div className={style.detailCntainer}>
            {this.props.inspectionType == '1'||(this.props.params&&this.props.params.inspectionType == '1') ? <div>
                <div className={style.title}>
                    <div className={style.line}></div>
                    <h3>6年免检办理流程</h3>
                    <div className={style.line}></div>
                </div>
                    <ProcessDetail/>
                </div> : <div>
                <div className={style.title}>
                    <div className={style.line}></div>
                    <h3>上线检办理流程</h3>
                    <div className={style.line}></div>
                </div>
                    <OverLineProcessDetail/>
                </div>}
        </div>
    }
}



export default ProcessDetails